import Constants

/**
 * System Privileges
 */
class Privilege {
    String privName
    String description

	String toString(){
		privName
	}

	static mapping = {
		table Constants.DOMAIN_TABLE_PREFIX + '_PRIV'
		roles joinTable: Constants.DOMAIN_TABLE_PREFIX + '_ROLE_PRIV'
	}

	static belongsTo = Role
	static hasMany=[roles: Role]

	static constraints = {
		privName(unique:true, blank:false, size:2..32)
		description(size:6..256)
	}
}
